Carbon


ThemeEraseProcPtr

Header: Appearance.h Carbon status: Supported

Draws a background.

typedef void(* ThemeEraseProcPtr) (
    const Rect *bounds, 
    UInt32 eraseData, 
    SInt16 depth, 
    Boolean isColorDev
);

You would declare your function like this if you were to name it MyThemeEraseCallback:

void MyThemeEraseCallback (
    const Rect *bounds, 
    UInt32 eraseData, 
    SInt16 depth, 
    Boolean isColorDev
);
bounds

A pointer to a structure of type Rect. The rectangle you are passed is set to the area in which you should draw. Your drawing function is called clipped to the rectangle in which you are allowed to draw; do not draw outside this region.

eraseData

An unsigned 32-bit value. You are passed data specifying how to draw, from the eraseData parameter of DrawThemeChasingArrows, DrawThemePopupArrow, DrawThemeTrack, or DrawThemeTrackTickMarks or from the inUserData parameter of DrawThemeButton.

depth

A signed 16-bit value. You are passed the bit depth (in bits per pixel) of the current graphics port.

isColorDev

A value of type Boolean. If true, indicates that you are drawing on a color device; a value of false indicates a monochrome device.

DISCUSSION

At the time your drawing function is called, the foreground text color and mode is already set to draw in the correct state (active or inactive) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the depth value and the value of the isColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw in color. Note that the Appearance Manager calls your MyThemeEraseCallback function for every device that the bounds rectangle intersects, so your application does not need to call the DeviceLoop function itself.

You should refer to your MyThemeEraseCallback function using a ThemeEraseUPP, which you can create with the NewThemeEraseProc macro.

You typically use the NewThemeEraseProc macro like this:

ThemeEraseUPP myThemeEraseUPP;

myThemeEraseUPP = NewThemeEraseProc(MyThemeEraseCallback);

You typically use the CallThemeEraseProc macro like this:

CallThemeEraseProc(myThemeEraseUPP, bounds, eraseData, depth, isColorDev);

VERSION NOTES

This function is available with Appearance Manager 1.1 and later.

AVAILABILITY

Supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)